<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:th="http://www.thymeleaf.org"	>
<head>
<meta charset="UTF-8">
<title>主页</title>
</head>
<body>
	<div align = "center">
  	    <img th:src="@{/login.jpg}"/>	
  	</div>
  	<div align = "center">
  		<h1>华侨大学选课系统</h1>
  		
  	</div>
    <div th:if="${error}"> 
    	无法登录，请确认账户密码。
    </div>
    <div align = "center">
  		<p>创建新用户
       	<a th:href="@{/register}">here</a> 注册</p>
    </div>
    

    <form method="POST" th:action="@{/}" id="loginForm" th:if="${nowUser} eq null">
      	<div align = "center">
	  		<h1>Login</h1>
	  		<h2>欢迎！</h2>
	  	</div>
   		<table align = "center">
  			<tr>
  				<td>
  					<label for="username">用户名: </label>
  				</td>
  				<td>
  					<input type="text" name="username" id="username" />
  				</td>
  			</tr>
  			<tr>
  				<td>
  					<label for="password">密码: </label>
  				</td>
  				<td>
  					<input type="password" name="password" id="password" />
  				</td>
  			</tr>
  			
  		</table>
    	
	     <div align = "center">
			<input type="submit" value="登录"/>
	    </div>
    </form>

	<form method="POST" th:action="@{/logout}" id="logoutForm" th:if="${nowUser} ne null">
		<div align="center">
      		<h2><p th:text="欢迎使用！+${nowUser.username}"></h2>
		</div>
		<table align="center">
    		<tr>
    			<td>
    				<button> <a th:href="@{/personinfo}">进入个人信息</a></button>
    			</td>
    			<td>
    				<button> <a th:href="@{/conclude}">选课展示</a></button>
    			</td>
    			<td>
    				<input type="submit" value="退出登录"/>
    			</td>
    		</tr>
    	</table>	
    </form>
	<div align="center">
		<img th:src="@{/校门2.jpg}"/>
	</div>
</body>
</html>